﻿@model EmgrMvc.Models.Device

@{
    ViewData["Title"] = "Details";
}

<h2>Details</h2>

<div>
    <h4>Device</h4>
    <hr />
    <dl class="dl-horizontal">
        <dt>
            @Html.DisplayNameFor(model => model.Name)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Name)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.Description)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Description)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.Type)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Type)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.ControllerNode)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.ControllerNode)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.Topic)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Topic)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.Data)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Data)
        </dd>
        <dt>
            @Html.DisplayNameFor(model => model.Status)
        </dt>
        <dd>
            @Html.DisplayFor(model => model.Status)
        </dd>

    </dl>
</div>
<div>
    @if (ViewBag.Catalog == "IR")
    {
        <a asp-action="ACPowerOn" asp-route-id="@Model.Id">打开红外控制设备</a> <br />
        <a asp-action="ACPowerOff" asp-route-id="@Model.Id">关闭红外控制设备</a> <br />

    }
    else if (ViewBag.Catalog == "WOL")
    {
        <a asp-action="WakeupPC" asp-route-id="@Model.Id">唤醒设备</a> <br />
    }
<p>
    <a asp-action="PowerOn" asp-route-id="@Model.Id">打开设备</a> <br />
    <a asp-action="PowerOff" asp-route-id="@Model.Id">关闭设备</a> <br />
</p>
    <a asp-action="Index">返回列表</a>
</div>
